Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

git-url-parse

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-url-parse

A high level git url parser for common git providers.

  • 11.6.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.7M
increased by1.54%
Maintainers
1
Weekly downloads
 
Created

What is git-url-parse?

The git-url-parse npm package is a utility for parsing Git URLs and extracting useful information from them. It supports various Git URL formats and provides methods to manipulate and retrieve different parts of the URL.

What are git-url-parse's main functionalities?

Parsing a Git URL

This feature allows you to parse a Git URL and get an object containing various parts of the URL such as the protocol, source, owner, name, and more.

const gitUrlParse = require('git-url-parse');
const parsed = gitUrlParse('https://github.com/IonicaBizau/git-url-parse.git');
console.log(parsed);

Extracting the owner and name

This feature allows you to extract specific parts of the Git URL, such as the owner and repository name.

const gitUrlParse = require('git-url-parse');
const parsed = gitUrlParse('https://github.com/IonicaBizau/git-url-parse.git');
console.log(parsed.owner); // 'IonicaBizau'
console.log(parsed.name); // 'git-url-parse'

Converting to a different URL format

This feature allows you to convert a Git URL from one format to another, such as from HTTPS to SSH.

const gitUrlParse = require('git-url-parse');
const parsed = gitUrlParse('https://github.com/IonicaBizau/git-url-parse.git');
const sshUrl = parsed.toString('ssh');
console.log(sshUrl); // 'git@github.com:IonicaBizau/git-url-parse.git'

Other packages similar to git-url-parse

Keywords

FAQs

Package last updated on 06 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc